// JavaScript Document
//為陣列Array添加一個push方法
//為陣列的末尾加入一個物件
if(!Array.prototype.push)
{
       Array.prototype.push=function ()
       {
var startLength=this.length;
for(var j=0;j<arguments.length;j++)
{
        this[startLength+j]=arguments[j];
}
return this.length;
        }
};
//對G函數的參數進行處理
function G()
{
       //定義一個陣列用來保存參數
       var elements=new Array();
       //迴圈分析G中參數的內容
       for(var j=0;j<arguments.length;j++)
       {
var element=arguments[j];
//如果參數的類型為string，則獲得以這個參數為ID的物件
if(typeof element=='string')
{
        element=document.getElementById(element);
}
//如果參數的長度為1
if(arguments.length==1)
{
        return element;
}
//將物件加入到陣列的末尾
elements.push(element);
       };
       return elements;
};
Function.prototype.bind=function (object)
{
       var __method=this;
       return function ()
       {
__method.apply(object,arguments);
       };
};
//綁定事件
Function.prototype.bindAsEventListener=function (object)
{
       var __method=this;
       return function (event){__method.call(object,event||window.event);};
};
Object.extend=function (destination,source)
{
       for(property in source)
       {
destination[property]=source[property];
       };
       return destination;
};
if(!window.Event)
{
       var Event=new Object();
};
Object.extend(
       Event,
       {
observers:false,
element:function (event)
{
        return event.target||event.srcElement;
},
isLeftClick:function (event)
{
        return (((event.which)&&(event.which==1))||((event.button)&&(event.button==1)));
},
pointerX:function (event)
{
        return event.pageX||(event.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},
pointerY:function (event)
{
        return event.pageY||(event.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},
stop:function (event)
{
        if(event.preventDefault)
        {
     event.preventDefault();
     event.stopPropagation();
        }
        else
        {
     event.returnValue=false;
     event.cancelBubble=true;
        };
},
findElement:function (event,tagName)
{
        var element=Event.element(event);
        while(element.parentNode&&(!element.tagName||(element.tagName.toUpperCase()!=tagName.toUpperCase())))
     element=element.parentNode;
        return element;
},
_observeAndCache:function (element,name,observer,useCapture)
{
        if(!this.observers)
     this.observers=[];
        if(element.addEventListener)
        {
     this.observers.push([element,name,observer,useCapture]);
     element.addEventListener(name,observer,useCapture);
        }
        else if(element.attachEvent)
        {
     this.observers.push([element,name,observer,useCapture]);
     element.attachEvent('on'+name,observer);
        };
},
unloadCache:function ()
{
        if(!Event.observers)
     return;
        for(var j=0;j<Event.observers.length;j++)
        {
     Event.stopObserving.apply(this,Event.observers[j]);
     Event.observers[j][0]=null;
        };
        Event.observers=false;
},
observe:function (element,name,observer,useCapture)
{
        var element=G(element);
        useCapture=useCapture||false;
        if(name=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||element.attachEvent))
     name='keydown';
        this._observeAndCache(element,name,observer,useCapture);
},
stopObserving:function (element,name,observer,useCapture)
{
        var element=G(element);
        useCapture=useCapture||false;
        if(name=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||element.detachEvent))
     name='keydown';
        if(element.removeEventListener)
        {
     element.removeEventListener(name,observer,useCapture);
        }
        else if(element.detachEvent)
        {
     element.detachEvent('on'+name,observer);
        };
}
       }
);
Event.observe(window,'unload',Event.unloadCache,false);
var Class=function ()
{
       var _class=function ()
       {
this.initialize.apply(this,arguments);
       };
       for(j=0;j<arguments.length;j++)
       {
superClass=arguments[j];
for(member in superClass.prototype)
{
        _class.prototype[member]=superClass.prototype[member];
};
       };
       _class.child=function ()
       {
return new Class(this);
       };
       _class.extend=function (f)
       {
for(property in f)
{
        _class.prototype[property]=f[property];
};
       };
       return _class;
};
//改變百度空間的最頂端和最低端的div的id值
//如果flag為begin，則為彈出狀態的id值
//如果flag為end，則為非彈出狀態的id值，即原本的id值
function space(flag)
{
       if(flag=="begin")
       {
var ele=document.getElementById("ft");
if(typeof(ele)!="undefined"&&ele!=null)
        ele.id="ft_popup";
ele=document.getElementById("usrbar");
if(typeof(ele)!="undefined"&&ele!=null)
        ele.id="usrbar_popup";
        }
        else if(flag=="end")
        {
var ele=document.getElementById("ft_popup");
if(typeof(ele)!="undefined"&&ele!=null)
        ele.id="ft";
ele=document.getElementById("usrbar_popup");
if(typeof(ele)!="undefined"&&ele!=null)
        ele.id="usrbar";
        };
};
//**************************************************Popup類快顯視窗***************************************************************
var Popup=new Class();
Popup.prototype={
//快顯視窗中框架的name名稱
iframeIdName:'ifr_popup',
initialize:function (config)
{
        //---------------彈出對話方塊的配置資訊------------------
        //contentType:設置內容區域為什麼類型：1為另外一個html檔 | 2為自訂html字串 | 3為confirm對話方塊 | 4為alert警告對話方塊
        //isHaveTitle:是否顯示標題列
        //scrollType：設置或獲取對話方塊中的框架是否可被滾動
        //isBackgroundCanClick：彈出對話方塊後，是否允許蒙布後的所有元素被點擊。也就是如果為false的話，就會有全屏蒙布，如果為true的話，就會去掉全屏蒙布
        //isSupportDraging：是否支持拖拽
        //isShowShadow：是否現實陰影
        //isReloadOnClose：是否刷新頁面，並關閉對話方塊
        //width：寬度
        //height：高度
        this.config=Object.extend({contentType:1,isHaveTitle:true,scrollType:'no',isBackgroundCanClick:false,isSupportDraging:true,isShowShadow:true,isReloadOnClose:true,width:540,height:400},config||{});
        //----------------對話方塊的參數值資訊------------------------
        //shadowWidth     ：陰影的寬度
        //contentUrl      ：html連結頁面
        //contentHtml     ：html內容
        //callBack       ：回檔的函數名
        //parameter       ：回檔的函數名中傳的參數
        //confirmCon      ：對話方塊內容
        //alertCon       ：警告框內容
        //someHiddenTag：頁面中需要隱藏的元素清單，以逗號分割
        //someHiddenEle：需要隱藏的元素的ID清單(和someToHidden的區別是：someHiddenEle是通過getElementById，而someToHidden是通過getElementByTagName，裡面放的是對象)
        //overlay       ：
        //coverOpacity ：蒙布的透明值
        this.info={shadowWidth:4,title:"",contentUrl:"",contentHtml:"",callBack:null,parameter:null,confirmCon:"",alertCon:"",someHiddenTag:"select,object,embed",someHiddenEle:"",overlay:0,coverOpacity:40};
        //設置顏色cColor:蒙布的背景, bColor:內容區域的背景, tColor:標題列和邊框的顏色,wColor:字體的背景色
        this.color={cColor:"#000",bColor:"#FFFFFF",tColor:"#f17f0b",wColor:"#FFFFFF"};
        this.dropClass=null;
        //用來放置隱藏了的物件清單，在hiddenTag方法中第一次調用
        this.someToHidden=[];
        //如果沒有標題列則不支持拖拽
        if(!this.config.isHaveTitle)
        {
     this.config.isSupportDraging=false;
        }
        //初始化
        this.iniBuild();
},
//設置配置資訊和參數內容
setContent:function (arrt,val)
{
        if(val!='')
        {
     switch(arrt)
     {
         case 'width':this.config.width=val;
         break;
         case 'height':this.config.height=val;
         break;
         case 'title':this.info.title=val;
         break;
         case 'contentUrl':this.info.contentUrl=val;
         break;
         case 'contentHtml':this.info.contentHtml=val;
         break;
         case 'callBack':this.info.callBack=val;
         break;
         case 'parameter':this.info.parameter=val;
         break;
         case 'confirmCon':this.info.confirmCon=val;
         break;
         case 'alertCon':this.info.alertCon=val;
         break;
         case 'someHiddenTag':this.info.someHiddenTag=val;
         break;
         case 'someHiddenEle':this.info.someHiddenEle=val;
         break;
         case 'overlay':this.info.overlay=val;
     };
        };
},
iniBuild:function ()
{
        G('dialogCase')?G('dialogCase').parentNode.removeChild(G('dialogCase')):function (){};
        var oDiv=document.createElement('span');
        oDiv.id='dialogCase';
        document.body.appendChild(oDiv);
},
build:function ()
{
        //設置全屏蒙布的z-index
        var baseZIndex=10001+this.info.overlay*10;
        //設置蒙布上的快顯視窗的z-index(比蒙布的z-index高2個值)
        var showZIndex=baseZIndex+2;
        //定義框架名稱
        this.iframeIdName='ifr_popup'+this.info.overlay;
        //設置圖片的主路徑
        var path="http://www.zzjs.net/img/";
        //關閉按鈕
        var close='<input type="image" id="dialogBoxClose" src="'+path+'20070815174325_dialogCloseF.gif" border="0" width="16" height="16" align="absmiddle" title="關閉"/>';
        //使用濾鏡設置物件的透明度
        var cB='filter: alpha(opacity='+this.info.coverOpacity+');opacity:'+this.info.coverOpacity/100+';';
        //設置全屏的蒙布
        var cover='<div id="dialogBoxBG" style="position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:'+baseZIndex+';'+cB+'background-color:'+this.color.cColor+';display:none;"></div>';
        //設置彈出的主視窗設置
        var mainBox='<div id="dialogBox" style="border:1px solid '+this.color.tColor+';display:none;z-index:'+showZIndex+';position:relative;width:'+this.config.width+'px;"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="'+this.color.bColor+'">';
        //設置視窗標題列
        if(this.config.isHaveTitle)
        {
     mainBox+='<tr height="24" bgcolor="'+this.color.tColor+'"><td><table style="-moz-user-select:none;height:24px;" width="100%" border="0" cellpadding="0" cellspacing="0" ><tr>'+'<td width="6" height="24"></td><td id="dialogBoxTitle" style="color:'+this.color.wColor+';font-size:16px;font-weight:bold;">'+this.info.title+' </td>'+'<td id="dialogClose" width="20" align="right" valign="middle">'+close+'</td><td width="6"></td></tr></table></td></tr>';
        }
        else
        {
     mainBox+='<tr height="10"><td align="right">'+close+'</td></tr>';
        };
        //設置視窗主內容區域
        mainBox+='<tr style="height:'+this.config.height+'px" valign="top"><td id="dialogBody" style="position:relative;"></td></tr></table></div>'+'<div id="dialogBoxShadow" style="display:none;z-index:'+baseZIndex+';"></div>';
        //如果有蒙布
        if(!this.config.isBackgroundCanClick)
        {
     G('dialogCase').innerHTML=cover+mainBox;
     G('dialogBoxBG').style.height=document.body.scrollHeight;
        }
        else
        {
     G('dialogCase').innerHTML=mainBox;
        }
        Event.observe(G('dialogBoxClose'),"click",this.reset.bindAsEventListener(this),false);
        //如果支援拖動,則設置拖動處理
        if(this.config.isSupportDraging)
        {
     dropClass=new Dragdrop(this.config.width,this.config.height,this.info.shadowWidth,this.config.isSupportDraging,this.config.contentType);
     G("dialogBoxTitle").style.cursor="move";
        };
        this.lastBuild();
},
lastBuild:function ()
{
        //設置confim對話方塊的具體內容
        var confirm='<div style="width:100%;height:100%;text-align:center;"><div style="margin:20px 20px 0 20px;font-size:16px;line-height:16px;color:#000000;">'+this.info.confirmCon+'</div><div style="margin:20px;"><input id="dialogOk" type="button" value=" 確定 "/> <input id="dialogCancel" type="button" value=" 取消 "/></div></div>';
        //設置alert對話方塊的具體內容
        var alert='<div style="width:100%;height:100%;text-align:center;"><div style="margin:20px 20px 0 20px;font-size:16px;line-height:16px;color:#000000;">'+this.info.alertCon+'</div><div style="margin:20px;"><input id="dialogYES" type="button" value=" 確定 "/></div></div>';
        var baseZIndex=10001+this.info.overlay*10;
        var coverIfZIndex=baseZIndex+4;
        //判斷內容類別型決定視窗的主內容區域應該顯示什麼
        if(this.config.contentType==1)
        {
     var openIframe="<iframe width='100%' style='height:"+this.config.height+"px' name='"+this.iframeIdName+"' id='"+this.iframeIdName+"' src='"+this.info.contentUrl+"' frameborder='0' scrolling='"+this.config.scrollType+"'></iframe>";
     var coverIframe="<div id='iframeBG' style='position:absolute;top:0px;left:0px;width:1px;height:1px;z-index:"+coverIfZIndex+";filter: alpha(opacity=00);opacity:0.00;background-color:#ffffff;'><div>";
     G("dialogBody").innerHTML=openIframe+coverIframe;
        }
        else if(this.config.contentType==2)
        {
     G("dialogBody").innerHTML=this.info.contentHtml;
        }
        else if(this.config.contentType==3)
        {
     G("dialogBody").innerHTML=confirm;Event.observe(G('dialogOk'),"click",this.forCallback.bindAsEventListener(this),false);
     Event.observe(G('dialogCancel'),"click",this.close.bindAsEventListener(this),false);
        }
        else if(this.config.contentType==4)
        {
     G("dialogBody").innerHTML=alert;
     Event.observe(G('dialogYES'),"click",this.close.bindAsEventListener(this),false);
        };
},
//重新載入快顯視窗的高度和內容
reBuild:function ()
{
        G('dialogBody').height=G('dialogBody').clientHeight;
        this.lastBuild();
},
show:function ()
{
        //隱藏一些在info中制定的元素
        this.hiddenSome();
        //快顯視窗居中
        this.middle();
        //設置陰影
        if(this.config.isShowShadow)
     this.shadow();
},
//設置回呼函數
forCallback:function ()
{
        return this.info.callBack(this.info.parameter);
},
//為快顯視窗設置陰影
shadow:function ()
{
        var oShadow=G('dialogBoxShadow');
        var oDialog=G('dialogBox');oShadow['style']['position']="absolute";
        oShadow['style']['background']="#000";
        oShadow['style']['display']="";
        oShadow['style']['opacity']="0.2";
        oShadow['style']['filter']="alpha(opacity=20)";
        oShadow['style']['top']=oDialog.offsetTop+this.info.shadowWidth;
        oShadow['style']['left']=oDialog.offsetLeft+this.info.shadowWidth;
        oShadow['style']['width']=oDialog.offsetWidth;oShadow['style']['height']=oDialog.offsetHeight;
},
//讓快顯視窗居中顯示
middle:function ()
{
        if(!this.config.isBackgroundCanClick)
     G('dialogBoxBG').style.display='';
        var oDialog=G('dialogBox');
        oDialog['style']['position']="absolute";
        oDialog['style']['display']='';
        var sClientWidth=document.body.clientWidth;
        var sClientHeight=document.documentElement.clientHeight;
		var scrollPos;
if (typeof window.pageYOffset != 'undefined') {
   scrollPos = window.pageYOffset;
}//歡迎來到站長特效網 ，我們的網址是www.zzjs.net，很好記，zz站長，js就是js特效，本站收集大量高品質js代碼，還有許多廣告代碼下載。
else if (typeof document.compatMode != 'undefined' &&
     document.compatMode != 'BackCompat') {
   scrollPos = document.documentElement.scrollTop;
}
else if (typeof document.body != 'undefined') {
   scrollPos = document.body.scrollTop;
}
        var sScrollTop=scrollPos;
        //alert("document.body.clientWidth = " + sClientWidth + "\ndocument.body.clientHeight" +sClientHeight);
        var sleft=(sClientWidth/2)-(oDialog.offsetWidth/2)+50;
		//alert(sleft);
        var iTop=-80+(sClientHeight/2+sScrollTop)-(oDialog.offsetHeight/2);
        var sTop=iTop>0?iTop:(sClientHeight/2+sScrollTop)-(oDialog.offsetHeight/2);
        //alert("var iTop=-80+(sClientHeight/2+sScrollTop)-(oDialog.offsetHeight/2);\n" + "sClientHeight is " + sClientHeight + "\nsScrollTop is " + sScrollTop);
       // alert("iTop is " + iTop);
        if(sTop<1)
     sTop="20";
        if(sleft<1)
     sleft="20";
        oDialog['style']['left']=(document.documentElement.clientWidth)/3+"px";
        oDialog['style']['top']=(document.documentElement.scrollTop+(document.documentElement.clientHeight)/10)+"px";
		window.onscroll = function(){
			oDialog['style']['top']=(document.documentElement.scrollTop+(document.documentElement.clientHeight)/10)+"px";
			 G('dialogBoxShadow').style.top=(document.documentElement.scrollTop+(document.documentElement.clientHeight)/10+4)+"px";
			};
       // alert("sleft is " + sleft);
    //  alert("sTop is " + sTop);
},
//刷新頁面，並關閉當前快顯視窗
reset:function ()
{
        if(this.config.isReloadOnClose)
        {
     top.location.reload();
        };
        this.close();
},
//關閉當前快顯視窗
close:function ()
{
        G('dialogBox').style.display='none';
        if(!this.config.isBackgroundCanClick)
     G('dialogBoxBG').style.display='none';
        if(this.config.isShowShadow)
     G('dialogBoxShadow').style.display='none';
        G('dialogBody').innerHTML='';
        this.showSome();
},
//隱藏someHiddenTag和someHiddenEle中的所有元素
hiddenSome:function ()
{//歡迎來到站長特效網r，我們的網址是www.zzjs.net，很好記，zz站長，js就是js特效，本站收集大量高品質js代碼，還有許多廣告代碼下載。
        //隱藏someHiddenTag中的所有元素
        var tag=this.info.someHiddenTag.split(",");
        if(tag.length==1&&tag[0]=="")
        {
     tag.length=0;
        }
        for(var j=0;j<tag.length;j++)
        {
     this.hiddenTag(tag[j]);
        };
        //隱藏someHiddenEle中的所有逗號分割的ID的元素
        var ids=this.info.someHiddenEle.split(",");
        if(ids.length==1&&ids[0]=="")
     ids.length=0;
        for(var j=0;j<ids.length;j++)
        {
     this.hiddenEle(ids[j]);
        };
        //改變頂部和底部的div的id值為彈出狀態的id值,祥見space的實現
        space("begin");
},
//隱藏一組元素
hiddenTag:function (tagName)
{
        var ele=document.getElementsByTagName(tagName);
        if(ele!=null)
        {
     for(var j=0;j<ele.length;j++)
     {
         if(ele[j].style.display!="none"&&ele[j].style.visibility!='hidden')
         {
      ele[j].style.visibility='hidden';
      this.someToHidden.push(ele[j]);
         };
     };
         };
     },
     //隱藏單個元素
     hiddenEle:function (id)
     {
        var ele=document.getElementById(id);
        if(typeof(ele)!="undefined"&&ele!=null)
        {
     ele.style.visibility='hidden';
     this.someToHidden.push(ele);
        }
     },
     //將someToHidden中保存的隱藏元素全部顯示
     //並恢復頂部和底部的div為原來的id值
     showSome:function ()
     {
        for(var j=0;j<this.someToHidden.length;j++)
        {
     this.someToHidden[j].style.visibility='visible';
        };
        space("end");
     }
        };
//********************************************************Dragdrop類(拖拽動作)************************************************************
var Dragdrop=new Class();
Dragdrop.prototype={
initialize:function (width,height,shadowWidth,showShadow,contentType)
{
        this.dragData=null;
        this.dragDataIn=null;
        this.backData=null;
        this.width=width;
        this.height=height;
        this.shadowWidth=shadowWidth;
        this.showShadow=showShadow;
        this.contentType=contentType;
        this.IsDraging=false;
        this.oObj=G('dialogBox');
        Event.observe(G('dialogBoxTitle'),"mousedown",this.moveStart.bindAsEventListener(this),false);
},
moveStart:function (event)
{
        this.IsDraging=true;
        if(this.contentType==1)
        {
     G("iframeBG").style.display="";
     G("iframeBG").style.width=this.width;
     G("iframeBG").style.height=this.height;
        };
        Event.observe(document,"mousemove",this.mousemove.bindAsEventListener(this),false);
        Event.observe(document,"mouseup",this.mouseup.bindAsEventListener(this),false);
        Event.observe(document,"selectstart",this.returnFalse,false);
        this.dragData={x:Event.pointerX(event),y:Event.pointerY(event)};
        this.backData={x:parseInt(this.oObj.style.left),y:parseInt(this.oObj.style.top)};
},
mousemove:function (event)
{
        if(!this.IsDraging)
     return ;
        var iLeft=Event.pointerX(event)-this.dragData["x"]+parseInt(this.oObj.style.left);
        var iTop=Event.pointerY(event)-this.dragData["y"]+parseInt(this.oObj.style.top);
        if(this.dragData["y"]<parseInt(this.oObj.style.top))
     iTop=iTop-12;
        else if(this.dragData["y"]>parseInt(this.oObj.style.top)+25)
     iTop=iTop+12;
        this.oObj.style.left=iLeft;
        this.oObj.style.top=iTop;
        if(this.showShadow)
        {
     G('dialogBoxShadow').style.left=iLeft+this.shadowWidth;
     G('dialogBoxShadow').style.top=iTop+this.shadowWidth;
        };
        this.dragData={x:Event.pointerX(event),y:Event.pointerY(event)};
        document.body.style.cursor="move";
},
mouseup:function (event)
{
        if(!this.IsDraging)
     return ;
        if(this.contentType==1)
     G("iframeBG").style.display="none";
     document.onmousemove=null;
     document.onmouseup=null;
     var mousX=Event.pointerX(event)-(document.documentElement.scrollLeft||document.body.scrollLeft);
     var mousY=Event.pointerY(event)-(document.documentElement.scrollTop||document.body.scrollTop);
     if(mousX<1||mousY<1||mousX>document.body.clientWidth||mousY>document.body.clientHeight)
     {
         this.oObj.style.left=this.backData["x"];
         this.oObj.style.top=this.backData["y"];
         if(this.showShadow)
         {
      G('dialogBoxShadow').style.left=this.backData.x+this.shadowWidth;
      G('dialogBoxShadow').style.top=this.backData.y+this.shadowWidth;
         };
     };
     this.IsDraging=false;
     document.body.style.cursor="";
     Event.stopObserving(document,"selectstart",this.returnFalse,false);
},
returnFalse:function ()
{
        return false;
}//歡迎來到站長特效網g，我們的網址是www.zzjs.net，很好記，zz站長，js就是js特效，本站收集大量高品質js代碼，還有許多廣告代碼下載。
       };
//begin popwin
function openshow(url,title,w,h,stype)
{
	g_pop=new Popup({contentType:stype,isReloadOnClose:false,width:w,height:h});
	g_pop.setContent("title",title);
	g_pop.setContent("contentUrl",url);
	g_pop.build();
	g_pop.show();
}//歡迎來到站長特效網，我們的網址是www.zzjs.net，很好記，zz站長，js就是js特效，本站收集大量高品質js代碼，h還有許多廣告代碼下載。
function g_close_pop_re()
{
	g_pop.close();
	location.reload();
}//歡迎來到站長特效網，我們的網址是www.zzjs.net，很好記，zz站長，js就是js特效c，本站收集大量高品質js代碼，還有許多廣告代碼下載。
function Comment(url,w,h)
{g_pop=new Popup({ contentType:1,isReloadOnClose:false,width:w,height:h});
	g_pop.setContent("title","任務快速選單");
	g_pop.setContent("scrollType","no");
	g_pop.setContent("contentUrl",url);
	g_pop.build();
	g_pop.show();
}//歡迎來到站長特效網，我們的網址是www.zzjs.net，很好記，zz站長，qjs就是js特效，本站收集大量高品質js代碼，還有許多廣告代碼下載。
function g_close_pop()
{
	g_pop.close();
	g_pop=null;
}//歡迎來到站長特效網，我們的網址是www.zzjs.net，很好記，zz站長，js就是js特效，本站收集大量高品質js代碼，還有許多廣告代碼下載。
function ShowAlert(title,content,w,h)
        {
           var pop=new Popup({ contentType:4,isReloadOnClose:false,width:w,height:h});
          pop.setContent("title",title);
            pop.setContent("alertCon",content);
           pop.build();
           pop.show();
      }
function Wclose(){
           	g_pop.close();
			g_pop=null;
			}
//end popwin
